// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

using Elastic.Transport;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

#nullable restore
namespace Elastic.Clients.Elasticsearch.Security
{
	public sealed class SecuritySamlCompleteLogoutRequestParameters : RequestParameters<SecuritySamlCompleteLogoutRequestParameters>
	{
	}

	public sealed partial class SecuritySamlCompleteLogoutRequest : PlainRequestBase<SecuritySamlCompleteLogoutRequestParameters>
	{
		internal override ApiUrls ApiUrls => ApiUrlsLookups.SecuritySamlCompleteLogout;
		protected override HttpMethod HttpMethod => HttpMethod.POST;
		protected override bool SupportsBody => true;
		[JsonInclude]
		[JsonPropertyName("realm")]
		public string Realm { get; set; }

		[JsonInclude]
		[JsonPropertyName("ids")]
		public Elastic.Clients.Elasticsearch.Ids Ids { get; set; }

		[JsonInclude]
		[JsonPropertyName("query_string")]
		public string? QueryString { get; set; }

		[JsonInclude]
		[JsonPropertyName("content")]
		public string? Content { get; set; }
	}

	public sealed partial class SecuritySamlCompleteLogoutRequestDescriptor : RequestDescriptorBase<SecuritySamlCompleteLogoutRequestDescriptor, SecuritySamlCompleteLogoutRequestParameters>
	{
		internal SecuritySamlCompleteLogoutRequestDescriptor(Action<SecuritySamlCompleteLogoutRequestDescriptor> configure) => configure.Invoke(this);
		public SecuritySamlCompleteLogoutRequestDescriptor()
		{
		}

		internal override ApiUrls ApiUrls => ApiUrlsLookups.SecuritySamlCompleteLogout;
		protected override HttpMethod HttpMethod => HttpMethod.POST;
		protected override bool SupportsBody => true;
		private string? ContentValue { get; set; }

		private Elastic.Clients.Elasticsearch.Ids IdsValue { get; set; }

		private string? QueryStringValue { get; set; }

		private string RealmValue { get; set; }

		public SecuritySamlCompleteLogoutRequestDescriptor Content(string? content)
		{
			ContentValue = content;
			return Self;
		}

		public SecuritySamlCompleteLogoutRequestDescriptor Ids(Elastic.Clients.Elasticsearch.Ids ids)
		{
			IdsValue = ids;
			return Self;
		}

		public SecuritySamlCompleteLogoutRequestDescriptor QueryString(string? queryString)
		{
			QueryStringValue = queryString;
			return Self;
		}

		public SecuritySamlCompleteLogoutRequestDescriptor Realm(string realm)
		{
			RealmValue = realm;
			return Self;
		}

		protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
		{
			writer.WriteStartObject();
			if (!string.IsNullOrEmpty(ContentValue))
			{
				writer.WritePropertyName("content");
				writer.WriteStringValue(ContentValue);
			}

			writer.WritePropertyName("ids");
			JsonSerializer.Serialize(writer, IdsValue, options);
			if (!string.IsNullOrEmpty(QueryStringValue))
			{
				writer.WritePropertyName("query_string");
				writer.WriteStringValue(QueryStringValue);
			}

			writer.WritePropertyName("realm");
			writer.WriteStringValue(RealmValue);
			writer.WriteEndObject();
		}
	}
}